<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>APanel - Login</title>
        <meta http-equiv="content-type" content="text/javascript;charset=UTF-8" />
        <link type="text/css" rel="stylesheet" href="{{"libraries/css/grid.css"|base_url}}"/>
        <link type="text/css" rel="stylesheet" href="{{"libraries/css/widgets.css"|base_url}}"/>
        <link type="text/css" rel="stylesheet" href="{{"libraries/css/bubble.css"|base_url}}"/>

        <script type="text/javascript" src="{{base_url()}}/libraries/script/jquery-1.9.0.js"></script>
        <script type="text/javascript" src="{{"libraries/ui/js/jquery-ui-1.9.2.custom.js"|base_url}}"></script>
        <link   type="text/css" rel="stylesheet" href="{{"libraries/ui/themes/base/jquery.ui.all.css"|base_url}}"/>
        <script type="text/javascript" src="{{"libraries/script/backend.jquery.1.1.9.js"|base_url}}"></script>

        <script type="text/javascript" src="{{"libraries/validation-engine/jquery.validationEngine-en.js"|base_url}}"></script>
        <script type="text/javascript" src="{{"libraries/validation-engine/jquery.validationEngine.js"|base_url}}"></script>
        <!--[if !IE]>
            <link   type="text/css" rel="stylesheet" href="{{"libraries/css/notie.css"|base_url}}"/>
        <![endif]-->
        <!--[if lt IE 10]>
            <style type="text/css">
                .pie{behavior: url('{{"libraries/css/pie-1.0/PIE.htc"|base_url}}');}
            </style>
        <![endif]-->
        <!--[if lt IE 9]>
            <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
            <link   type="text/css" rel="stylesheet" href="{{"libraries/css/ielt9.css"|base_url}}"/>
        <![endif]-->
        <!--[if IE 8]>
            <link   type="text/css" rel="stylesheet" href="{{"libraries/css/ie8.css"|base_url}}"/>
        <![endif]-->
        <!--[if IE 7]>
            <link   type="text/css" rel="stylesheet" href="{{"libraries/css/ie7.css"|base_url}}"/>
        <![endif]-->
    </head>
    <body>
        <script type="text/javascript">var base_url = "{{""|base_url}}", edialog, ndialog;</script>
        {{*<div id="reg-box-step-2" class="grid_8 b-g-c-w p-a z-i-1 b-d-c-ddd reprefix-3 upfix-3 m-t-- b-s-d-big b-r-4 pie t-50-pc l-50-pc">
        <h4 class="b-g-c-blue h-g-1 l-h-40 p-l-20 p-r-20 b-r-t-4">Thông tin bổ xung</h4>
        <div class="p-20 p-r">
        <div class="p-a t-0 l-0 b-0 r-0 tranf-w-50 d-p-n" style="z-index: 1001"></div>
        <div class="p-a t-0 l-0 b-0 r-0 b-g-ldg b-g-c-w _overflow" style="z-index: 1002"></div>
        </div>
        </div>*}}
        <div id="login" class="b-g-c-w p-r z-i-1 d-p-n z-i-10k">
            <div class="p-l-20 p-b-20 p-r-20 p-t-12  b-g-c-w p-r" >
                <div class="p-a t-0 l-0 b-0 r-0 tranf-w-50 d-p-n" style="z-index: 1001"></div>
                <div class="p-a t-0 l-0 b-0 r-0 b-g-ldg b-g-c-w i-l-d d-p-n" style="z-index: 1002"></div>
                <div class="content-biz w-240-">
                    <form id="frm-login" name="frm-login" action="{{"widgets/ei"|base_url}}" method="POST" 
                          onsubmit="login();
                return false;" 
                          target="integration_asynchronous" autocomplete="off" 
                          >
                        <table>
                            <tbody>
                                <tr>
                                    <td>Username</td>
                                    <td>
                                        {{*<input type="text" style="background-color: #fff" disabled="1"
                                               value="{{$smarty.session.auth['oauth']['name']}}" data-putto="#eu"
                                               id="_name" name="_name"
                                               class="classic-input w-240 validate[required]">
                                        <input type="hidden" id="_username" name="_username" value="{{$smarty.session.auth['oauth']['email']}}" class="classic-input">*}}
                                        <input type="text"
                                               value="" data-putto="#eu"
                                               id="_username" name="_username"
                                               class="classic-input w-180 validate[required]">
                                    </td>
                                </tr>
                                <tr>
                                    <td></td><td><p id="eu"></p></td>
                                </tr>
                                <tr>
                                    <td>Password</td>
                                    <td><input type="password" id="_password" name="_password" 
                                               value="" data-putto="#ep"
                                               class="classic-input w-180 validate[required]"></td>
                                </tr>
                                <tr>
                                    <td></td><td><p id="ep"></p></td>
                                </tr>
                                <tr>
                                    <!--<td class="t-a-c p-t-4" style="vertical-align: middle">
                                        <a class="a t-d-n" href="http://pushclimbing.com/OAuth">
                                            <img src="{{base_url()}}libraries/images/16/google1.png" title="Đăng nhập bằng tài khoản Google">
                                            <img src="{{base_url()}}libraries/images/16/gmail.png" title="Đăng nhập bằng tài khoản Gmail">
                                        </a>
                                    </td>-->
                                    <td colspan='2' class="p-t-4 t-a-c">
                                        <button type="submit" class="classic-button">Đăng nhập</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        {{*<div class="p-r p-b-12">
                        <p>Username</p>
                        <div class="p-r">
                        <input 
                        type="text"
                        class="w-240 b-g-c-i validate[required]" 
                        value="" 
                        minlength="10"
                        maxlength="120" 
                        id="_username" name="_username"
                        />
                        </div>
                        </div>
                        <div class="clear"></div>
                        <!--      alias      -->
                        <div class="p-r p-b-12">
                        <p><label class="d-p-b w-i" for="_password">Password</label></p>
                        <div class="p-r">
                        <input 
                        type="password" 
                        class="w-i b-g-c-i validate[required]" 
                        value="" 
                        minlength="10"
                        maxlength="120" 
                        id="_password" name="_password"
                        />
                        </div>
                        </div>
                        <div class="clear"></div>
                        <div class="p-r">
                        <button class="classic-button" type="button">Auth</button>
                        <div id="auth_login" class="b-t-c g-d-w f-r">Login</div>
                        </div>
                        <div class="clear"></div>*}}
                    </form>
                </div>
            </div>
        </div>
        <script>
            $(document).ready(function() {
                $("#frm-login").validationEngine();
                var dig = new bckdialog({
                    title: 'Login',
                    hideclose: true,
                    icon: '<img class="p-a t-8 l-8 w-16 h-16" src="{{base_url()}}libraries/images/16/login.png"/>',
                    message: $("#login")
                }).open();
            });
            function login() {
                new backend({
                    url: "{{"service/auth/exc_login"|base_url}}",
                    data: {
                        username: $("#_username").val(),
                        password: $("#_password").val()
                    },
                    datatype: "json",
                    callback: function(data) {
                        if (data.result < 0) {
                            bckdialog({type: 'error'}).open(data.message);
                        } else {
                            uiMessage(data.message);
                        }
                    }
                }).call();
            }
        </script>